<?php
namespace App\Models;

use App\Models\Simple\DATAModel;


/*
 * Mock travel destination data.
 * Note that we don't have to extend CodeIgniter's model for now
 */

 class Places extends DATAModel {
    protected $origin = WRITEPATH . 'data/placesData.DATA';
    protected $keyField = 'id';
    protected $validationRules = [];



    public function findAll() {
        return $this->data;
    }

    public function find($id = null) {
        if (!empty($id) && isset($this->data[$id])) {
            return $this->data[$id];
        }
        return null;
    }

}
